Method and apparatus for displaying video data

ABSTRACT

Provided is a method and apparatus for displaying video data without a display delay. In the method, a code indicating an end of stream is appended so that the code is appended behind a last video stream included in a stream to be displayed when only a part of an input stream including one or more video streams is displayed. In addition, the last video stream is displayed which is appended with the code indicating an end of stream.

CROSS-REFERENCE TO RELATED PATENT APPLICATIONS

This is a Divisional Application of U.S. application Ser. No.11/859,870, filed Sep. 24, 2007, which claims the benefit of KoreanPatent Application No. 10-2007-0030056, filed on Mar. 27, 2007 in theKorean Intellectual Property Office, the disclosures of which areincorporated herein in their entirety by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

Methods and apparatuses consistent with the present invention relate toa video data display, and more particularly, to a method and apparatusfor displaying video data without a display delay that occurs in a videodecoder that cannot detect an end of picture.

2. Description of the Related Art

Video decoders conventionally display a decoded picture by detecting aheader of a next picture or by detecting a code indicating an end ofstream (e.g., sequence end code (SED)/end of sequence (EOS)) rather thanthe end of picture. The term of SEC/EOS indicates the end of stream,where the SEC is used in the moving picture experts group (MPEG)-1/2video data standards, and the EOS is used in the video codec (VC)-1video data standard or the H.264 video data standard.

The reason why the video decoders operate as described above is that theend of the picture cannot be easily detected from a video elementarystream (ES). In general, video data is continuously displayed inresponse to a picture start code if one stream that amounts to tens ofhours is continuously displayed. However, in some cases, for example,when a menu screen composed of one picture is used, or when a streamhaving a large video gap is used such as a slideshow application,decoded video data stored in a buffer cannot be displayed.

Accordingly, a display delay occurs when a time for displaying a pictureon a screen is significantly different from a presentation time stamp(PTS) value of the picture. In general, the PTS value is allocated torespective pictures which are completed by combining one or more videostreams.

FIG. 1 is a block diagram of a conventional apparatus for displaying anMPEG-2 transport stream (TS).

Referring to FIG. 1, the apparatus includes a de-multiplexer 110, adecoder 120, a decoding buffer selector 130, a video buffer 140, adisplay buffer selector 150, and a video display 160.

The de-multiplexer 110 receives the MPEG-2 TS. The received MPEG-2 TS issequentially transmitted to the decoder 120 according to an arrival timestamp (ATS).

The decoder 120 decodes the video data received from the de-multiplexer110, thereby completing one picture.

The decoding buffer selector 130 selects any one of buffers 141 to 14Nincluded in the video buffer 140 to store the decoded video data. Thedisplay buffer selector 150 selects any one of the buffers 141 to 14Nstoring the video data to be displayed on a screen.

The video display 160 displays on the screen the video data stored inany one of the buffers 141 to 14N selected by the display bufferselector 150.

According to the prior art, when a header of a next picture or anSEC/EOS is detected, the decoder 120 increments by 1 a pointer of thedecoding buffer selector 130 and a pointer of the display bufferselector 150 so that the pointer of the display buffer selector 150indicates a buffer that stores a picture to be displayed next.

For example, if a picture currently being displayed on the screen is inassociation with video data stored in the first video buffer 141, thepointer of the decoding buffer selector 130 indicates the second videobuffer 142, and the pointer of the display buffer selector 150 indicatesthe first video buffer 141. The decoder 120 decodes the video data andthen stores the decoded video data in the second buffer 142 indicated bythe pointer of the decoding buffer selector 130.

In this case, when the decoder 120 detects the head of picture or theSEC/EOS, the decoding buffer selector 130 increments its pointer by 1,thereby indicating the third buffer 143. The display buffer selector 150also increments its pointer by 1, thereby indicating the second videobuffer 142. As a result, the video data stored in the second videobuffer 142 is displayed. That is, the decoded video data stored in thevideo buffers 141 to 14N is updated at a moment when these buffers areindicated by the pointer of the display buffer selector 150.

The display buffer selector 150 is sequentially synchronized with thedecoding buffer selector 130 so that only a completely decoded pictureis displayed on the screen. To this end, the pointer of the displaybuffer selector 150 has to be different by 1 from the pointer of thedecoding buffer selector 130.

Referring to FIGS. 7A and 7B, when only a stream 720 included in aninput stream 710 is displayed according to the prior art, the decoder120 decodes a last video stream 722 included in the stream 720 to bedisplayed and then waits until a header of a next picture or an SEC/EOSis detected. Then, the decoded data, that is, the last video stream 722,is stored in the video buffer 140. Thus, the last video stream 722 isnot displayed. That is, a display delay occurs in which certain videodata is not displayed or is displayed with a time delay.

In order to implement a Blu-ray disc, which is one of applications ofthe present invention, a function is required whereby even a singlepicture can be timely displayed according to the PTS. However, since theconventional video decoder detects the header of the picture or theSEC/EOS rather than the end of picture, a display error occurs when thedecoded picture is stored in a buffer and thus is not displayed on thescreen for a certain period of time.

FIG. 2 illustrates an example of an MPEC-2 TS when a PTS differencebetween consecutive pictures is large.

Referring to FIG. 2, the MPEC-2 TS includes a first video stream 210, asecond video stream 220, a third video stream 230, a fourth video stream240, and an SEC/EOS 250. The PTS difference between the first videostream 210 and the second video stream 220 is significantly large. Inthis case, each stream may be used for a menu screen. That is, therespective streams of FIG. 2 are not continuously displayed but are usedone by one as a separate menu screen.

For example, if a PTS value of the stream 210 to be used for a menuscreen is 0x8000, an application reads only the stream 210 having a PTSvalue of 0x8000. In this case, the SEC/EOS 250 is not present behind thestream 210 having a PTS value of 0x8000. Immediately after data is read,the decoder 120 decodes the data and stores the data in the video buffer140. The data is not displayed on a screen and rather remains in thevideo buffer 140 until the SEC/EOS 250 or a picture start code of a nextpicture is detected. Therefore, according to the prior art, a menuscreen cannot be displayed when only a video decoder is used without anyparticular processing.

FIG. 3 illustrates an example of an MPEG-2 TS in which interactivegraphic (IG) streams are present between a video stream and an SEC/EOS.

Referring to FIG. 3, the MPEG-2 TS includes a video stream 310, IGstreams 320, 330, and 340, and an SEC/EOS 350.

Although the MPEG-2 TS is composed of one picture, the IG streams 320,330, and 340 each having a significant data size are present between theSEC/EOS 350 and the video stream 310. In this case, as described above,the decoder 120 decodes video data immediately after the video data isreceived, and then stores the decoded video data in the video buffer140. However, the stored video data is not displayed until a picturestart code of the picture or the SEC/EOS 350 is detected.

Due to the appended IG streams 320, 330, and 340, the decoder 120 maydetect the SEC/EOS 350 with a significant time delay. Such time delaymay prevent the video data from being displayed according to an AV syncalgorithm. Even if the video data is displayed, a display error mayoccur since a time for displaying the video data on the screen has alarge discrepancy with respect to a PTS value of the picture.

As described above, the conventional video decoder detects a header ofthe picture or an SEC/EOS instead of an end of the picture. Thus, if amenu screen composed of one picture or a stream having a large video gapis displayed, or when only a part of an input stream is displayed, adisplay delay may occur when decoded video data stored in a buffercannot be displayed.

SUMMARY OF THE INVENTION

The present invention provides a method and apparatus for displayingvideo data without a display delay.

According to an aspect of the present invention, there is provided amethod of displaying video data, including: appending a code indicatingan end of stream so that the code is appended behind a last video streamincluded in a stream to be displayed when only a part of an input streamincluding one or more video streams is displayed; and displaying thelast video stream appended with the code indicating an end of stream.

The displaying of the last video stream may further include decodingvideo data corresponding to the last video stream appended with the codeindicating an end of stream.

The video data may be input in an MPEG (moving picture experts group)-2TS (transport stream) format.

The video data input in an MPEG-2 TS format may further include arrivaltime information.

Displaying only a part of the input stream may include a case that thedecoded video data is the last video stream included in the stream to bedisplayed.

Displaying only a part of the input stream may include a case thatdisplay is scheduled to be end after a part of the input stream isdisplayed.

Displaying only a part of the input stream may include a case that anext stream is scheduled to be input after the part of input stream isdisplayed.

Displaying only a part of the input stream may include a case that a newstream is scheduled to be displayed after a stream currently beingdisplayed stops being displayed.

The appending of a code indicating an end of stream may further include:extracting a start point and an end point of the stream to be displayedamong the input stream; searching for reversely the last video streamfrom the end point; and appending the code indicating an end of streamso that the code is appended behind the found last video stream.

The appending of a code indicating an end of stream may further includecopying arrival time information of the last video stream to arrivaltime information of the appended code indicating an end of stream.

The code indicating an end of stream may be SEC (sequence end code) orEOS (end of sequence).

The SEC or the EOS may be selected from the group consisting of anMPEG-2 SEC, a H.264 EOS, and VC (video codec)-1 EOS according to a videocodec.

According to another aspect of the present invention, there is provideda method of displaying video data, including: decoding an input streamincluding one or more video streams; and comparing reproduction timeinformation of a picture to be displayed next with system timeinformation that is reference time information, and, if a differencetherebetween is below a predetermined value, controlling video data,which is included in the decoded stream, to be displayed on a screen.

The system time information may be determined as reproduction timeinformation of a start video picture of a stream to be displayed.

In the controlling of video data, reproduction time information of apicture currently being displayed may be compared with reproduction timeinformation of a picture to be displayed next, and if a differencetherebetween is below the predetermined value, the controlling may be nolonger carried out and is delayed for a certain period of time.

According to another aspect of the present invention, there is providedan apparatus for displaying video data, including: a code appenderappending a code indicating an end of stream so that the code isappended behind a last video stream included in a stream to be displayedwhen only a part of an input stream including one or more video streamsis displayed; and a display displaying the last video stream appendedwith the code indicating an end of stream.

The apparatus may be a Blu-ray disc apparatus.

The apparatus may further include a decoder decoding video datacorresponding to the last video stream appended with the code indicatingan end of stream.

The video data may be input in an MPEG (moving picture experts group)-2TS (transport stream) format.

The video data input in an MPEG-2 TS format may further include arrivaltime information.

Displaying only a part of the input stream may include a case that thedecoded video data is the last video stream included in the stream to bedisplayed.

Displaying only a part of the input stream may include a case thatdisplay is scheduled to be end after a part of the input stream isdisplayed.

Displaying only a part of the input stream may include a case that anext stream is scheduled to be input after the part of the input streamis displayed.

Displaying only a part of the input stream may include a case that a newstream is scheduled to be displayed after a stream currently beingdisplayed stops being displayed.

The code appender may extract a start point and an end point of thestream to be displayed among the input stream, searches for reverselythe last video stream from the end point, and append the code indicatingthe end of stream so that the code is appended behind the found lastvideo stream.

The code appender may further include a copy unit copying arrival timeinformation of the last video stream to arrival time information of theappended code indicating an end of stream.

The code indicating an end of stream may be SEC (sequence end code) orEOS (end of sequence).

According to another aspect of the present invention, there is providedan apparatus for displaying video data, including: a decoder decoding aninput stream including one or more video streams; a controller comparingreproduction time information of a picture to be displayed next withsystem time information that is reference time information, and, if adifference therebetween is below a predetermined value, controllingvideo data, which is included in the decoded stream, to be displayed ona screen; and a display displaying the video data decoded by the decoderon a screen under the control of the controller.

The system time information may be determined as reproduction timeinformation of a start video picture.

The controller may compare reproduction time information of a picturecurrently being displayed with reproduction time information of apicture to be displayed next, and, if a difference therebetween is belowa predetermined value, does not operate and waits for a certain periodof time.

According to another aspect of the present invention, there is provideda computer-readable medium having embodied thereon a computer programfor executing the method of displaying video data, including: appendinga code indicating an end of stream so that the code is appended behind alast video stream included in a stream to be displayed when only a partof an input stream including one or more video streams is displayed; anddisplaying the last video stream appended with the code indicating anend of stream.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other features of the present invention will become moreapparent by describing in detail exemplary embodiments thereof withreference to the attached drawings in which:

FIG. 1 is a block diagram of a conventional apparatus for displaying amoving picture experts group (MPEG)-2 transport stream (TS);

FIG. 2 illustrates an example of an MPEG-2 TS when a presentation timestamp (PTS) difference between consecutive pictures is large;

FIG. 3 illustrates an example of an MPEG-2 TS in which interactivegraphic (IG) streams are present between a video stream and a sequenceend code (SEC);

FIG. 4 illustrates a packet structure of Blu-ray audio and video (BDAV)MPEG-2 TS;

FIG. 5 is a block diagram of an apparatus for displaying an MPEG-2 TS inwhich an SEC/end of sequence (EOS) is appended according to an exemplaryembodiment of the present invention;

FIG. 6 is a flowchart of a method of appending an SEC/EOS according toan exemplary embodiment of the present invention;

FIGS. 7A, 7B, and 7C illustrates an example of a method of appending anSEC/EOS according to an exemplary embodiment of the present invention;

FIG. 8 illustrates an SEC/EOS in association with an MPEG-2 codecaccording to an exemplary embodiment of the present invention;

FIG. 9 illustrates an SEC/EOS in association with a H.264 codecaccording to an exemplary embodiment of the present invention;

FIG. 10 illustrates an SEC/EOS in association with a video codec (VC)-1codec according to an exemplary embodiment of the present invention;

FIG. 11 is a block diagram of an apparatus for displaying an MPEG-2 TSusing the difference between a system time clock (STC) and a PTSaccording to an exemplary embodiment of the present invention;

FIG. 12 is a flowchart of a method of displaying a media file accordingto an exemplary embodiment of the present invention;

FIG. 13 is an algorithm of a method of displaying an MPEG-2 TS using thedifference between an STC and a PTS according to an exemplary embodimentof the present invention; and

FIG. 14 illustrates an example of a method of displaying an MPEG-2 TSusing the difference between an STC and a PTS according to an exemplaryembodiment of the present invention.

DETAILED DESCRIPTION OF THE EXEMPLARY EMBODIMENTS OF THE INVENTION

Hereinafter, exemplary embodiments of the present invention will bedescribed with reference to the accompanying drawings.

FIG. 4 illustrates a packet structure of Blu-ray audio and video (BDAV)moving picture experts group (MPEG)-2 transport stream (TS).

A Blu-ray disc (BD) is a representative application of the presentinvention. In the BD, a 4-byte arrival time stamp (ATS) 410 is added toa 188-byte MPEG-2 transport packet 420, and thus a total of a 192-bytetransport packet is used. The ATS 410 includes arrival time information.A de-multiplexer checks for the ATS 410 from the MPEG-2 transport packet420 so that a video elementary stream (ES) is transmitted to a decoderaccording to the ATS 410. That is, since the de-multiplexer adjusts adata transmission rate according to the ATS 410, if the ATS 410 of videodata is sporadically arranged, the video data is slowly input to thedecoder. The ATS 410 corresponds to time information compliant with adata transfer standard, and has to be logically synchronized withdisplay time information such as a presentation time stamp (PTS) and adecoding time stamp (DTS). The PTS includes reproduction timeinformation indicating a reproduction time point. The DTS includesdecoding time information indicating a decoding time point.

FIG. 5 is a block diagram of an apparatus for displaying an MPEG-2 TS inwhich an SEC/EOS is appended according to an embodiment of the presentinvention. The apparatus includes an SEC/EOS appender 510, ade-multiplexer 520, a decoder 530, a decoding buffer selector 540, avideo buffer 550, a display buffer selector 560, and a video display570.

The SEC/EOS appender 510 receives the MPEG-2 TS including one or morevideo streams, and then appends an SEC/EOS so as to be appended behind alast video stream included in a stream to be displayed among thereceived MPEG-2 TS. Details thereof will be described below withreference to FIGS. 6 and 7A, 7B, and 7C.

The de-multiplexer 520 sequentially transmits to the decoder 530 thestream to be displayed where the SEC/EOS is appended by the SEC/EOSappender 510 according to the ATS.

The decoder 530 decodes the received stream (or video data) to be storedin any one of video buffers 551 to 55N, which is included in the videobuffer 550 and is selected by the decoding buffer selector 540, therebycompleting one picture.

The decoding buffer selector 540 selects any one of buffers 551 to 55Nto store the decoded video data. The display buffer selector 560 selectsany one of buffers 551 to 55N storing the video data to be displayed ona screen.

The video display 570 displays on the screen the video data stored inany one of buffers 551 to 55N selected by the display buffer selector560.

For example, if a picture currently being displayed on the screen is inassociation with video data stored in the first video buffer 551, apointer of the decoding buffer selector 540 indicates the second videobuffer 552, and a pointer of the display buffer selector 560 indicatesthe first video buffer 541. The decoder 530 decodes the video data andthen stores the decoded video data in the second buffer 542 indicated bythe pointer of the decoding buffer selector 540. In this case, when thedecoder 520 detects the head of picture or an SEC/EOS, the decodingbuffer selector 540 increments its pointer by 1, thereby indicating thethird buffer 553. The display buffer selector 560 also increments itspointer by 1, thereby indicating the second video buffer 552. As aresult, the video data stored in the second video buffer 552 isdisplayed.

Referring to FIGS. 7A, 7B, and 7C, when a part of input stream 720included in an input stream 710 is displayed according to the prior art,the decoder 530 decodes a last video stream 722 included in the stream720 to be displayed and then waits until a header of a next picture oran SEC/EOS is detected. Then, the decoded video data is stored in thevideo buffer 550. Thus, the last video stream 722 is not displayed. Thatis, a display delay occurs in which certain video data is not displayedor is displayed with a time delay.

Accordingly, in the apparatus for displaying the MPED-2 TS of thepresent invention, the decoder 530 detects an SEC/EOS 728 immediatelyafter the last video stream 722 is completely decoded using the SEC/EOS728 appended by the SEC/EOS appender 510, thereby moving the pointer ofthe display buffer selector 560. Therefore, the video display 570 candisplay the decoded video data on the screen without a display delay.

By appending an SEC/EOS, display can be achieved without a display delayeven in the case when the last video stream included in a stream to bedisplayed does not contain the SEC/EOS. Examples of such case include:(a) when decoded data corresponds to a last video stream included in astream to be displayed; (b) when display is scheduled to end after apart of an the input stream is displayed; (c) when a next stream isscheduled to be input after the part of input stream is displayed; (d)when a new stream is scheduled to be displayed after the streamcurrently being displayed stops being displayed; (e) when a remotecontrol input is scheduled to be received from a user after the part ofthe stream is read in a state that a decoder is operating; (f) when theuser wants to stop decoder operation by detecting the completion ofdecoding; and (g) when video data is displayed with a time gap such as aslideshow. Alternatively, display can also be achieved without a displaydelay even when a stream to be displayed has a significant video gap.

Accordingly, conventional problems can be solved in which a picture isdisplayed with a time delay or in which the picture is refused to bedisplayed according to the AV sync algorithm because the last videostream included in the stream to be displayed does not contain theSEC/EOS.

FIG. 6 is a flowchart of a method of appending an SEC/EOS according toan exemplary embodiment of the present invention.

Referring to FIG. 6, the method of appending an SEC/EOS includes threeoperations as follows.

A start point and an end point of a stream to be displayed are extracted(operation 610).

Next, a last video stream is searched for by reversely searching thestream to be displayed from the end point extracted in operation 610(operation 620).

Next, the SEC/EOS is appended right behind the found last video stream(operation 630).

FIGS. 7A, 7B, and 7C illustrate an example of a method of appending anSEC/EOS according to an exemplary embodiment of the present invention.

Referring to FIGS. 7A, 7B, and 7C, the SEC/EOS is appended into a streamwhich is input in the format of an MPEG-2 TS according to the flowchartof FIG. 6.

Referring to FIG. 7A, a start point 712 and an end point 714 areextracted from a stream 720 to be displayed and included in an inputstream 710 that is received according to operation 610 of FIG. 6.

Referring to FIG. 7B, a video stream 722 included in a stream 720 to beprocessed reversely from an end point 714 extracted according tooperation 620 of FIG. 6 is searched for.

Referring to FIG. 7C, an SEC/EOS 728 is appended right behind the videostream 722 according to operation 630 of FIG. 6. The ATS of the lastvideo stream 722 may be copied to the ATS of the SEC/EOS 728. Then, thevideo stream 722 and the SEC/EOS 728 can be simultaneously input to thedecoder 530 and be displayed on the screen while decoding.

FIGS. 8 to 10 are examples of an SEC/EOS according to codec types. Aplurality of video streams are compressed in accordance with respectivecodec types (e.g., MPEG-2, H.264, VC-1, etc) and are packetized in theformat of an MPEG-2 TS. In the present invention, the appended SEC/EOScorresponds to each codec type. The codec type is not limited thereto,and thus various other codec types may also be used.

FIG. 11 is a block diagram of an apparatus for displaying an MPEG-2 TSusing the difference between a system time clock (STC) and a PTSaccording to an exemplary embodiment of the present invention. Systemtime information indicates reference time information of a system and isimplemented using the STC or the like. The apparatus for displaying anMPEG-2 TS of the present invention includes a de-multiplexer 1110, adecoder 1120, a decoding buffer selector 1130, a video buffer 1140, adisplay buffer selector 1150, a video display 1160, a controller 1170,and a Blu-ray navigation 1180.

The de-multiplexer 1110 transmits the MPEG-2 TS that is input from aBlu-ray disc to the decoder 1120.

The decoder 1120 decodes the received video data to be stored in any oneof video buffers 1141 to 114N, which is included in the video buffer1140 and is selected by the decoding buffer selector 1130, therebycompleting one picture.

The decoding buffer selector 1130 selects any one of video buffers 1141to 114N to store the decoded video data. The display buffer selector1150 selects any one of buffers 1141 to 114N storing the video data tobe displayed on the screen.

The video display 1160 displays on the screen the video data stored inany one of buffers 1141 to 114N selected by the display buffer selector1150.

The controller 1170 allows the video data, which is stored in the videobuffer 1140, to be displayed according to a PTS value 1176 of a picturecurrently being displayed, a PTS value 1172 of a picture to be displayednext, and STC value. The operation of the controller 1170 will bedescribed below in greater detail with reference to FIGS. 12 to 14.

Now, the present invention will be described under the assumption that aBlu-ray application is used. However, the present invention is notlimited thereto, and thus it will be understood by those skilled in theart that the present invention can be performed through various otherapplications.

In the Blu-ray application according to an exemplary embodiment of thepresent invention, PTS value of a picture to be displayed next may beobtained using media clip information. This is because, according to theBlu-ray standard, PTS value of an I-frame to be displayed can be knownbecause the PTS value is contained in the clip information. The Blu-raynavigation 1180 extracts the PTS value of a picture to be displayed next1172 by using the clip information of the Blu-ray disc, and thentransmits the extracted PTS 1172 to the controller 1170.

The PTS value of a picture currently being displayed 1176 is transmittedto the controller 1170 via the decoder 1120. The decoder 1120 canrecognize a PTS value of a picture when decoding of the picture iscompleted. In this case, since the decoding of the picture currentlybeing displayed on the screen is completed, the decoder 1120 cantransmit the PTS value 1176 to the controller 1170.

STC is reference time information of the system. An STC 1174 value istransmitted to the controller 1170 via the de-multiplexer 1110. The STCvalue 1174 may continuously be compensated for using a program clockreference (PCR) or may be set to a PTS value of a picture that is thefirst picture among to be displayed. The STC value 1174 has already beensynchronized. The controller 1170 compares the PTS value 1176, the STCvalue 1174, and the PTS value 1172 so as to determine whether a decodedpicture stored in the buffer 1140 will be displayed on the screen.

FIG. 12 is a flowchart of a method of displaying a media file accordingto an exemplary embodiment of the present invention.

The method of displaying a media file includes six operations asfollows.

An STC of a de-multiplexer is determined (operation 1210). In order todisplay video data (or media file), a plurality of pieces of system timeinformation (e.g., STC, PTS, etc.) need to be synchronized with oneanother. In general, when a PCR packet is included in a stream, the STCis determined according thereto. However, in preparation for the casethat the PCR packet is not included in the stream to be displayed, theSTC may be determined using a PTS of a start picture of the stream to bedisplayed which is obtained using the aforementioned clip information.Accordingly, the STC and the PTS are synchronized with each other.

Next, decoding of the video data begins (operation 1220).

Next, the operation of a controller begins (operation 1230). The PTS maybe obtained after the decoder completes decoding. Therefore, in order toobtain a current PTS, the controller may operate after decoding starts.

Next, the decoded media file is displayed (operation 1240).

Next, the operation of the controller is stopped (operation 1250).

Next, the operation of the decoder is stopped (operation 1260).

FIG. 13 is an algorithm of a method of displaying an MPEG-2 TS using thedifference between an STC and a PTS according to an exemplary embodimentof the present invention.

Referring to the algorithm of FIG. 13, when a media file (or video data)is first displayed, the controller 1170 continuously operates until themedia file stops being displayed (operation 1310).

While operating, if a certain condition is satisfied (for example, theresult of respective operations 1322, 1324, and 1326 is positive, or theresult of operation 1360 is negative), the controller 1170 stops itsoperation and waits for a predetermined period of time (operation 1320).

Next, the PTS value 1176 of a picture currently being displayed isobtained (operation 1330).

Next, the STC value 1174 is obtained (operation 1174).

Next, the PTS value 1172 of a picture to be displayed next is obtained(operation 1350).

Next, if the PTS value 1172 cannot be obtained using clip information,the controller 1170 stops its operation and waits for a certain periodof time (operation 1322). This is because no more pictures are deemed tobe left to be displayed, and thus the controller 1170 does not need tooperate.

Next, if the difference between the PTS value 1176 and the PTS value1172 is below a predetermined value, the controller 1170 stops itsoperation and waits for a certain period of time (operation 1324).Though this operation, it is determined whether the video datacorresponds to general video data or particular video data having avideo gap. Thus, if the video data has a small video gap, the video datais regarded as the general video data. In the present exemplaryembodiment, when the difference between the PTS 1176 and the PTS value1172 is 2 seconds or less, the video data is regarded as the generalvideo data, and as a result, the controller 1170 stops its operation andwaits for a certain period of time.

Next, if the PTS 1176 is equal to the PTS value 1172, the controller1170 stops its operation and waits for a certain period of time(operation 1326). This is to prevent a picture from being displayedagain when the picture has already been displayed.

Next, if the difference between the current STC value 1174 and the PTSvalue 1172, which is obtained using the clip information and is inassociation with a picture to be displayed next, is below thepredetermined value, the controller 1170 operates (operation 1360). Inthis operation, if the difference between the PTS value 1172 and the STCvalue 1174 is below the predetermined value, a picture to be displayedis regarded as not having been displayed yet. As a result, a pointer ofthe display buffer selector 1150 increases, and thus a next picture isdisplayed.

FIG. 14 illustrates an example of a method of displaying an MPEG-2 TSusing the difference between an STC and a PTS according to an exemplaryembodiment of the present invention.

Referring to FIG. 14, a PTS value of a picture to be displayed isobtained using clip information as described above. If the picture withthe PTS value is not displayed, the controller 1170 operates to increasea pointer of the display buffer selector 1150 of a video output terminalthereby displaying the picture on the screen. Since the Blu-rayapplication has a data structure having an ATS, the decoder 1120 canprevent under-buffering or over-buffering. Therefore, it is ensured thatthe decoder 1120 can have one or more video streams. Referring to FIG.14, when an STC 1410 increases and thus is within a predetermined rangeof a picture PTS value, the controller 1170 operates to increase thepointer of the display buffer selector 1150, thereby displaying a newpicture on the screen. That is, when the STC value 1410 increases andthus the difference with a PTS value 1422 of a picture 1 to be displayednext is within the predetermined range, the controller 1170 operates todisplay the picture 1 on the screen. Thereafter, when the STC value 1410increases until the difference with a PTS value 1432 of a picture 2 tobe displayed next is within the predetermined range, the controller 1170operates so that the picture 1 currently being displayed is replacedwith the picture 2, thereby displaying the picture 2 on the screen.

According to the present invention, a sequence end code (SEC)/end ofsequence (EOS) is properly appended in an input stream withoutstructural changes in the existing video decoder. Thus, display can beachieved normally without a display delay which occurs when only videodata with some video gap is reproduced, or only a part of the inputstream is reproduced.

In addition, a display error can be avoided that may occur when a streamcomposed of one picture cannot be displayed according to a presentationtime stamp (PTS).

In another exemplary embodiment of the present invention, the inventioncan be embodied as computer readable codes on a computer readablerecording medium.

While the present invention has been particularly shown and describedwith reference to exemplary embodiments thereof, it will be understoodby those skilled in the art that various changes in form and details maybe made therein without departing from the spirit and scope of theinvention as defined by the appended claims. The exemplary embodimentsshould be considered in a descriptive sense only and not for purposes oflimitation. Therefore, the scope of the invention is defined not by thedetailed description of the invention, but by the appended claims, andall differences within the scope will be construed as being included inthe present invention.

What is claimed is:
 1. A method of displaying video data, comprising:decoding a first stream; and comparing reproduction time information ofa picture to be displayed next with system time information, and, if adifference therebetween is below a predetermined value, controllingvideo data of the decoded first stream for displaying on a screen. 2.The method of claim 1, wherein the system time information is determinedas reproduction time information of a start video picture of a stream tobe displayed.
 3. The method of claim 2, wherein, in the controlling ofvideo data, reproduction time information of a picture currently beingdisplayed is compared with the reproduction time information of thepicture to be displayed next, and if a difference therebetween is belowthe predetermined value, the controlling is no longer carried out and isdelayed for a period of time.
 4. An apparatus for displaying video data,comprising: a decoder which decodes a first stream; a controller whichcompares reproduction time information of a picture to be displayed nextwith system time information, and, if a difference therebetween is belowa predetermined value, controlling video data of the decoded firststream for displaying; and a display which displays the video datadecoded by the decoder on a screen under a control of the controller. 5.The apparatus of claim 4, wherein the system time information isdetermined as reproduction time information of a start video picture. 6.The apparatus of claim 5, wherein the controller compares reproductiontime information of a picture currently being displayed with thereproduction time information of the picture to be displayed next, and,if a difference therebetween is below a predetermined value, does notoperate and waits for a period of time.